<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            display: flex;
            flex-wrap: wrap;
        }
        div {
            height: 200px;
            width: 25%;
            outline: 1px solid red;
            line-height: 200px;
            text-align: center;
            font-size: 100px;
        }

        @media screen and (max-width: 1000px) {
            div {
                width: 50%;
            }
        }

        @media screen and (max-width: 500px) {
            div {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</body>
</html>